<template>
    <div>
<!--      三级联动全局组件(不用引用)-->
      <TypeNav></TypeNav>
      <ListContainer></ListContainer>
      <TodayRecommend></TodayRecommend>
      <Rank></Rank>
      <Like></Like>
      <Floor v-for="(f,index) in floorList" :key="f.id" :list="f"></Floor>
      <Brand></Brand>
    </div>
</template>

<script>
import ListContainer from "@/pages/Home/ListContainer";
import TodayRecommend from "@/pages/Home/TodayRecommend";
import Rank from "@/pages/Home/Rank";
import Like from "@/pages/Home/Like";
import Floor from "@/pages/Home/Floor";
import Brand from "@/pages/Home/Brand";
//拿到floor数据
import {mapState} from "vuex";
export default {
  name: "Home",
  components: {ListContainer,TodayRecommend,Rank,Like,Floor,Brand},
  mounted() {

      //通过vuex发起ajax请求(floor)
      this.$store.dispatch('getFloorList')
    },
  computed:{
    //拿道floor数据
    //简写 floorList：state => state.home.floorList
    ...mapState({
      floorList: (state) => {
       return  state.home.floorList
      }
    })
    // ...mapState("home",["floorList"])
  }
}
</script>

<style scoped>

</style>